﻿using Learun.Util;
using SqlSugar;
using System;
namespace Learun.Application.TwoDevelopment.ZZDT_EC

{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2021-02-18 15:17
    /// 描 述：项目管理
    /// </summary>
    [SugarTable("ec_project")]
    public class ec_projectEntity
    {
        #region 实体成员
        /// <summary>
        /// 项目ID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string ProjectId { get; set; }
        /// <summary>
        /// 项目名称
        /// </summary>
        /// <returns></returns>
        public string ProjectName { get; set; } = "";
        /// <summary>
        /// 项目代号
        /// </summary>
        /// <returns></returns>
        public string ProjectCode { get; set; } = "";

        ///// <summary>
        ///// 船检
        ///// </summary>
        //public string ShipCheck { get; set; } = "";
        /// <summary>
        /// 船名（中文）
        /// </summary>
        /// <returns></returns>
        public string ShipNameCN { get; set; } = "";
        /// <summary>
        /// 船名（英文）
        /// </summary>
        /// <returns></returns>
        public string ShipNameEN { get; set; } = "";
        /// <summary>
        /// 船型（中文）
        /// </summary>
        /// <returns></returns>
        public string ShipTypeCN { get; set; } = "";
        /// <summary>
        /// 船型（英文）
        /// </summary>
        /// <returns></returns>
        public string ShipTypeEN { get; set; } = "";
        /// <summary>
        /// 船级社（id）。和船检的概念有些冲突
        /// </summary>
        /// <returns></returns>
        public string ShipSociety { get; set; } = "";
        /// <summary>
        /// 船东
        /// </summary>
        /// <returns></returns>
        public string ShipOwner { get; set; } = "";
        /// <summary>
        /// 挂旗国（船籍国）
        /// </summary>
        /// <returns></returns>
        public string FlagState { get; set; } = "";
        /// <summary>
        /// IMO编号
        /// </summary>
        /// <returns></returns>
        public string IMONumber { get; set; } = "";
        /// <summary>
        /// 项目更多描述一
        /// </summary>
        /// <returns></returns>
        public string Describe1 { get; set; } = "";
        /// <summary>
        /// 项目更多描述二
        /// </summary>
        /// <returns></returns>
        public string Describe2 { get; set; } = "";
        /// <summary>
        /// 项目更多描述三
        /// </summary>
        /// <returns></returns>
        public string Describe3 { get; set; } = "";
        /// <summary>
        /// 项目更多描述四
        /// </summary>
        /// <returns></returns>
        public string Describe4 { get; set; } = "";
        /// <summary>
        /// 项目更多描述五
        /// </summary>
        /// <returns></returns>
        public string Describe5 { get; set; } = "";
        /// <summary>
        /// 项目序号
        /// </summary>
        /// <returns></returns>
        public int? ProjectIndex { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            UserInfo userInfo = LoginUserInfo.Get();
            this.ProjectId = Guid.NewGuid().ToString();
            this.CreateUserID = userInfo.userId;
            this.CreateTime = Time.MySqlTime;
        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
            this.UpdateTime = Time.MySqlTime;

            this.ProjectId = keyValue;
        }
        #endregion
        #region 扩展字段
        /// <summary> 
        /// 船型（中文）
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string ShipTypeCNName { get; set; }
        /// <summary> 
        /// 船型（英文）
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string ShipTypeENName { get; set; }
        /// <summary> 
        /// 船级社(通过id查出来的名字）
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string ShipSocietyName { get; set; }
        /// <summary> 
        /// 挂旗国（船籍国）
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string FlagStateName { get; set; }

        /// <summary> 
        /// 创建人名称 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string CreateUserName { get; set; }
        #endregion
    }
}

